function jcb_filerenamer()
%% This is a dummy function to protect this function from running automatically
disp(['This file should not be run automatically, it''s not very safe!\n' ...
      'Use cell mode to run it manually']);
return

%% This is the actual business end
filelist = ls('clicks_090_*');
filelist = strtrim(mat2cell(filelist,ones(size(filelist,1),1),size(filelist,2)));
%%
for ii=1:length(filelist)
        [success, message, messageid] = movefile(filelist{ii},...
            strrep(filelist{ii},'clicks_090_0','clicks_090_scan_0'));
%     if ~isempty(regexp(filelist{ii},'profile_data', 'once'))
%         [success, message, messageid] = ...
%             movefile(filelist{ii},...
%                 strrep(filelist{ii},'_profile_data','_nearfield'));
%     elseif ~isempty(regexp(filelist{ii},'index_data', 'once'))
%         [success, message, messageid] = ...
%             movefile(filelist{ii},...
%                 strrep(filelist{ii},'_index_data','_index'));
%     else
%         [success, message, messageid] = ...
%             movefile(filelist{ii},strrep(filelist{ii},'_data','_spectra'));
%     end
%         [success, message, messageid] = ...
%             movefile(filelist{ii},...
%                 strrep(filelist{ii},'_z_','_z'));
%     if ~isempty(regexp(filelist{ii},'scan_\d_', 'once'))
%         [success, message, messageid] = ...
%            movefile(filelist{ii},...
%                 [filelist{ii}(1:5) '0' filelist{ii}(6:end)]);
%     end
%     if ~isempty(strfind(filelist{ii},'half_separation'))
%         [success, message, messageid] = movefile(filelist{ii},...
%             strrep(filelist{ii},'half_separation','d6'));
%     else
%         [success, message, messageid] = movefile(filelist{ii},...
%             [filelist{ii}(1:7),'_d12',filelist{ii}(8:end)]);
%     end
end
